#define _CRT_SECURE_NO_WARNINGS 1
class Solution {
public:
    void mysort(vector<vector<int>>& schedule, int left, int right)
    {
        if (left >= right) return;
        int key = schedule[left][0];
        int begin = left, end = right;
        for (int i = left; i <= right;)
        {
            if (schedule[i][0] < key) swap(schedule[i++], schedule[left++]);
            else if (schedule[i][0] > key) swap(schedule[i], schedule[right--]);
            else i++;
        }
        mysort(schedule, begin, left - 1);
        mysort(schedule, right + 1, end);
    }
    bool hostschedule(vector<vector<int> >& schedule) {
        mysort(schedule, 0, schedule.size() - 1);
        for (int i = 0; i < schedule.size() - 1; i++)
        {
            if (schedule[i][1] > schedule[i + 1][0]) return false;;
        }
        return true;
    }
};